@extends('backend::layout')
@section('title',$page_title)
@push('styles')
    <link href="{{asset(config('view.plugin').'/layui/layui_ext/cascader/cascader.css')}}" rel="stylesheet">
@endpush
@section('content')
    @component('backend::component.form.form')
        @slot('page_title')  {{$pos_info->pos_name}}广告位{{$page_title}} @endslot
        @slot('formId') slide @endslot
        @slot('action') {{url()->current()}} @endslot
        @component('backend::component.form.form-group')
            @slot('title') 广告标题 @endslot
            @component('backend::component.form.input')
                @slot('name') ad_name @endslot
                @slot('value') {{$info->ad_name ?? '好聚点'}} @endslot
            @endcomponent
        @endcomponent

        @component('backend::component.form.form-group')
            @slot('title') 宣传图 @endslot
            @php
                $imgList = [];
                if (isset($info->resource_link)){
                    $imgList = [$info->resource_link=>$info->resource_link];
                }
            @endphp
            @component('backend::component.upload.upload_img',['imgList'=>$imgList])
                @slot('name') resource_link @endslot
                @slot('title') 上传图片 @endslot
                @slot('img_num')1 @endslot
                @slot('group') xc @endslot
                @slot('value') {{$info->resource_link ?? ''}} @endslot
            @endcomponent
            @slot('remark') 图片大小为:宽{{$pos_info->ad_width}}px  高{{$pos_info->ad_height}}px @endslot
        @endcomponent

        @component('backend::component.form.form-group')
            @slot('title') 访问地址 @endslot
            @component('backend::component.form.input')
                @slot('name') ad_link @endslot
                @slot('value') {{$info->ad_link ?? 'http://www.hjd123.com'}} @endslot
            @endcomponent
            @slot('remark')可以不填,如果为外链请加http:// @endslot
        @endcomponent

        @component('backend::component.form.form-group')
            @slot('title') 状态 @endslot
            <div>
                @foreach(['0'=>'禁用','1'=>'启用'] as $value=>$title)
                    @component('backend::component.radio')
                        @slot('title') {{$title}} @endslot
                        @slot('name') status @endslot
                        @slot('value') {{$value}} @endslot
                        @if($value ==  ($info->type ?? 1))
                            @slot('checked') checked @endslot
                        @endif
                    @endcomponent
                @endforeach
            </div>
        @endcomponent
        @slot('buttons')
            @component('backend::component.form.button')
                @slot('title') 提交 @endslot
                @slot('params') {"formId":"#slide"} @endslot
                @slot('class') btn-min-width ajax-form @endslot
            @endcomponent
            @component('backend::component.form.button')
                @slot('title') 重置 @endslot
                @slot('type') reset @endslot
                @slot('color') danger @endslot
                @slot('class') btn-min-width @endslot
            @endcomponent
        @endslot
    @endcomponent
@endsection
@include('backend::component.upload.upload_js')